class RtestsController < ApplicationController
  # GET /rtests
  # GET /rtests.xml
  def index
    @rtests = Rtest.find(:all)

    respond_to do |format|
      format.html # index.rhtml
      format.xml  { render :xml => @rtests.to_xml }
    end
  end

  # GET /rtests/1
  # GET /rtests/1.xml
  def show
    @rtest = Rtest.find(params[:id])

    respond_to do |format|
      format.html # show.rhtml
      format.xml  { render :xml => @rtest.to_xml }
    end
  end

  # GET /rtests/new
  def new
    @rtest = Rtest.new
  end

  # GET /rtests/1;edit
  def edit
    @rtest = Rtest.find(params[:id])
  end

  # POST /rtests
  # POST /rtests.xml
  def create
    @rtest = Rtest.new(params[:rtest])

    respond_to do |format|
      if @rtest.save
        flash[:notice] = 'Rtest was successfully created.'
        format.html { redirect_to rtest_url(@rtest) }
        format.xml  { head :created, :location => rtest_url(@rtest) }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @rtest.errors.to_xml }
      end
    end
  end

  # PUT /rtests/1
  # PUT /rtests/1.xml
  def update
    @rtest = Rtest.find(params[:id])

    respond_to do |format|
      if @rtest.update_attributes(params[:rtest])
        flash[:notice] = 'Rtest was successfully updated.'
        format.html { redirect_to rtest_url(@rtest) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @rtest.errors.to_xml }
      end
    end
  end

  # DELETE /rtests/1
  # DELETE /rtests/1.xml
  def destroy
    @rtest = Rtest.find(params[:id])
    @rtest.destroy

    respond_to do |format|
      format.html { redirect_to rtests_url }
      format.xml  { head :ok }
    end
  end
end
